package com.atwl.school_system.controller;

import com.atwl.school_system.bean.Category;
import com.atwl.school_system.service.CategoryService;
import com.atwl.school_system.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    @RequestMapping("/cate/list")
    public R getCategoryList() {
        List<Category> list = categoryService.getCategoryList();
        return R.ok().setData(list);
    }
}
